home *** CD-ROM | disk | FTP | other *** search
/ .net (French) 1997 February / .net Magazine (FR) - Issue 04 - Feb 1997.iso / mac / NEWS / □cindymailer□ / Voice Mail < prev   
Text File  |  1996-05-03  |  2KB  |  77 lines

  1.   global pathName
  2.   put "Ñ Temp Sound Ñ " & the ticks into soundName
  3.   put pathName & ":Sound Cache ─:" & "Downloaded Sounds" & ":" into outFolder
  4.   if there is a folder outFolder then
  5.     fullRemove outFolder
  6.   end if
  7.   createFolder outFolder
  8.   put outFolder & soundName into outFile
  9.   open file outfile
  10.   write theArticle to file outfile
  11.   close file outfile
  12.   --break apart binhexed attachments into separate files, so
  13.   --Stuffit Expander can handle it.  I don't know why it can't
  14.   --handle a bunch at once.  Harumph!
  15.   put 0 into noAttachments
  16.   put 0 into char1
  17.   put empty into allFound
  18.   repeat forever
  19.     put fulloffset(return & "(This file must be converted with BinHex",temp,char1) into char1
  20.     if char1 is not 0 then
  21.       add 1 to noAttachments
  22.       put char1 & return after allFound
  23.       add 10 to char1
  24.     else
  25.       exit repeat
  26.     end if
  27.   end repeat
  28.   put bg fld "unbinhexer" into appName
  29.   if there is a file appname then
  30.    set itemDelimiter to ":"
  31.   put last item of appName into shortAppName
  32.   if noAttachments < 2 then
  33.     --0 or 1 attachments to extract
  34.     open outfile with appname
  35.     wait until the suspended is true
  36.     wait 1 second
  37.     wait until the suspended is false
  38.  else
  39.     --extract separate attachments
  40.     set itemDelimiter to ":"
  41.     put outFile into tempFile
  42.     put "ÑNewsmailer Temp FileÑ" into last item of tempFile
  43.     put 1 into firstChar
  44.     put 1 into lineNo
  45.     repeat forever
  46.       put line lineNo of allFound into temp1
  47.       if temp1 is empty then exit repeat
  48.       put line (lineNo + 1) of allFound into temp2
  49.       if temp2 is empty then
  50.         put length(temp) into temp2
  51.       else
  52.         subtract 1 from temp2
  53.       end if
  54.       put char temp1 to temp2 of temp into temp3
  55.       open file tempFile
  56.       write temp3 to file tempFile
  57.       close file tempFile
  58.       open tempFile with appName
  59.       wait until the suspended is true
  60.       wait 1 second
  61.       wait until the suspended is false
  62.       add 1 to lineNo
  63.     end repeat
  64.     fullremove tempfile
  65.   end if
  66.   put findFile(outFolder,"Ñ") into allFiles
  67.   wait 1 second
  68.   repeat with X = 1 to the number of lines in allFiles
  69.     fullRemove (line X of allFiles)
  70.   end repeat
  71.   put findFile(outFolder,"") into allFiles
  72.   repeat with X = 1 to the number of lines in allFiles
  73.     put line X of allFiles into theDoc
  74.     launchDoc theDoc
  75.   end repeat
  76. end if
  77.